<div class="todolist">
    <input type="text" [(ngModel)]="todoTask" /> <button (click)="addtask()">添加</button>

    <hr>

    <ul>
        <li *ngFor="let item of taskList;let key=index;">
            <button (click)="deletetask(key)">X</button>
        </li>
    </ul>
</div>